<div class="login-container">
  <form class="login-form">
    <div [class]="hasError ? 'login-input-box error' : 'login-input-box'">
      <input type="text" required (focus)="handleInputFocus()" />
      <label>{{ hasError ? "用户名或密码错误" : "用户名" }}</label>
    </div>
    <div [class]="hasError ? 'login-input-box error' : 'login-input-box'">
      <input type="password" required (focus)="handleInputFocus()" />
      <label>{{ hasError ? "用户名或密码错误" : "密码" }}</label>
    </div>
    <div class="login-button-box">
      <button (click)="handleLogin($event)">登录</button>
    </div>
  </form>
</div>
